#!/bin/sh
export JAVA_HOME="/Users/jw/jdk-17.0.6.jdk/Contents/Home"
export MAVEN_HOME="/Users/jw/apache-maven-3.6.3"
export PATH="$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH"
mvn -U clean package -DskipTests=true
rm -rf ./target/zip-sources
mkdir ./target/zip-sources
mkdir ./target/zip-sources/conf
mkdir ./target/zip-sources/conf/debezium
mkdir ./target/zip-sources/conf/jmx
mkdir ./target/zip-sources/logs
mkdir ./target/zip-sources/data
mkdir ./target/zip-sources/data/debezium
cp ./src/main/resources/application*.properties ./target/zip-sources/conf/
cp ./src/main/resources/debezium/debezium.properties ./target/zip-sources/conf/debezium/debezium.properties
cp ./src/main/resources/jmx/config.yaml ./target/zip-sources/conf/jmx/config.yaml
cp ./src/main/resources/log/logback-spring.xml ./target/zip-sources/conf/logback-spring.xml
cp -r ./bin ./target/zip-sources
cp -r ./lib ./target/zip-sources
cp ./target/server.jar ./target/zip-sources/lib/server.jar
cd ./target
zip -r server.zip ./zip-sources/**
